package common

import (
	"astgram/model/vo"
	"context"
)

func GetUser(ctx context.Context) *vo.UserClaims {
	v := ctx.Value("AuthToken")
	if v == nil {
		return &vo.UserClaims{
			UserID: 123,
		}
	}
	user, ok := v.(*vo.UserClaims)
	if !ok || user == nil {
		return &vo.UserClaims{
			UserID: 123,
		}
	}
	return user
}
